// reduce实现map


const arr = [1, 2, 3, 4];
const newArr = arr.reduce((acc, current) => {
  acc.push(current * 2);  // 这里将每个元素乘以2，模拟map中对元素的处理逻辑
  return acc;
}, []);

console.log(newArr); 